<?php
session_start();
include('database.php');


$query ="select * from users where email='$_POST[forgot_email]'";
$result = $mysqli->query($query) or die($mysqli->error.__LINE__);

if($result->num_rows == 1) {
//if exist
		while($row = $result->fetch_array()) {

		header("Location: email.php?target=forgot_pass&email=$row[email]&username=$row[username]");
		}
}else
{
//if not exist
header("Location: index.php?error=forgot_email#page_three");
}	










?>